{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import math\n",
    "import random\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "def GA(n_iteration, populationSize, codeLen, targetFunction, crossOverRate, mutationRate):\n",
    "    population = initPopulation(populationSize, codeLen)\n",
    "    bestScores = []\n",
    "    bestIndividuals = []\n",
    "    for i in range(n_iteration):\n",
    "        population = select(population, targetFunction)\n",
    "        population = crossOver(population, crossOverRate, codeLen)\n",
    "        population = mutate(population, mutationRate)\n",
    "        bestIndividual, bestScore = bestAmongPopulation(population, targetFunction)\n",
    "        bestScores.append(bestScore)\n",
    "        bestIndividuals.append(bestIndividual)\n",
    "\n",
    "    return bestIndividuals, bestScores\n",
    "\n",
    "def initPopulation(populationSize, codeLen):\n",
    "    population = []\n",
    "    for i in range(populationSize):\n",
    "        encode = \"\"\n",
    "        for j in range(codeLen):\n",
    "            encode = encode + str(np.random.randint(0, 2))\n",
    "        population.append(encode)\n",
    "    return population\n",
    "\n",
    "def select(population, targetFunction):\n",
    "    populationSize = len(population)\n",
    "    newPopulation = []\n",
    "    fitnessContainer = []\n",
    "    fitnessSum = 0.0\n",
    "    for i in range(populationSize):\n",
    "        fitness = targetFunction(population[i])\n",
    "        if fitness > 0:\n",
    "            fitnessSum += fitness\n",
    "            fitnessContainer.append(fitnessSum)\n",
    "        else:\n",
    "            fitnessContainer.append(0.0)\n",
    "    for i in range(populationSize):\n",
    "        fitnessContainer[i] /= fitnessSum\n",
    "\n",
    "    for i in range(populationSize):\n",
    "        rd = np.random.uniform(0, 1)\n",
    "        for j in range(populationSize):\n",
    "            if fitnessContainer[j] > rd:\n",
    "                newPopulation.append(population[j])\n",
    "                break\n",
    "    return newPopulation\n",
    "    \n",
    "def crossOver(population, crossOverRate, codeLen):\n",
    "    populationSize = len(population)\n",
    "    random.shuffle(population)\n",
    "    pairSize = int(populationSize // 2)\n",
    "    father = population[:pairSize]\n",
    "    mather = population[pairSize:]\n",
    "    childPopulation = []\n",
    "    for i in range(pairSize):\n",
    "        rd = np.random.uniform(0, 1)\n",
    "        if rd < crossOverRate:\n",
    "            crossPosition = np.random.randint(1, codeLen)\n",
    "            fatherCrossPart = father[i][crossPosition:]\n",
    "            matherCrossPart = mather[i][crossPosition:]\n",
    "            childFirst = father[i][:crossPosition] + matherCrossPart\n",
    "            childSecond = mather[i][:crossPosition] + fatherCrossPart\n",
    "            childPopulation.append(childFirst)\n",
    "            childPopulation.append(childSecond)\n",
    "        else:\n",
    "            childPopulation.append(father[i])\n",
    "            childPopulation.append(mather[i])\n",
    "    assert len(childPopulation) == populationSize\n",
    "    return childPopulation\n",
    "\n",
    "def mutate(population, mutationRate):\n",
    "    populationSize = len(population)\n",
    "    for i in range(populationSize):\n",
    "        rd = np.random.uniform(0, 1)\n",
    "        if rd < mutationRate:\n",
    "            individualSize = len(population[i])\n",
    "            mutationPositon = np.random.randint(0, individualSize)\n",
    "            population[i] = population[i][:mutationPositon] + str(int(population[i][mutationPositon]) ^ 1) + population[i][mutationPositon+1:]\n",
    "    return population\n",
    "\n",
    "def bestAmongPopulation(population, targetFunction):\n",
    "    bestIndividual = population[0]\n",
    "    bestScore = targetFunction(bestIndividual)\n",
    "    populationSize = len(population)\n",
    "    for i in range(1, populationSize):\n",
    "        if targetFunction(population[i]) > bestScore:\n",
    "            bestScore = targetFunction(population[i])\n",
    "            bestIndividual = population[i]\n",
    "\n",
    "    return bestIndividual, bestScore"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "def targetFunction(encoded):\n",
    "    x = decode(encoded)\n",
    "    y = x + 5 * math.sin(5 * x) + 2 * math.cos(3 * x)\n",
    "    return y\n",
    "\n",
    "def decode(x):\n",
    "    y = 0 + int(x, 2) / (2 ** 17 - 1) * 9\n",
    "    return y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "crossOverRate = 0.9\n",
    "mutateRate = 0.05\n",
    "n_iteration = 10000\n",
    "codeLen = 17\n",
    "populationSize = 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'Best Fitness per Iteration')"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEGCAYAAACQO2mwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAA3P0lEQVR4nO3dd5xcdfX4/9eZLdnNZrNpm2RTNwnpgbQlkFBDCSEgSFMQkaZBQFBREVS6QhThh8pHERRBv4AgiCAtRBBCE1JIQggJqZDKppdN23J+f9w7u7OzU+7MTt/zzGMfmblzy/vOvXPPfdcrqooxxhgTii/dCTDGGJO5LEgYY4wJy4KEMcaYsCxIGGOMCcuChDHGmLDy052AROrWrZtWVlamOxnGGJM15s2bt0VVy8N9nlNBorKykrlz56Y7GcYYkzVE5LNIn1txkzHGmLAsSBhjjAnLgoQxxpiwLEgYY4wJy4KEMcaYsCxIGGOMCcuChDHGmLByqp9Eqnz6xW6uefxDvjGpP4Jw2mEVlBUXsGHHPu6euYz1O/ZRV9/AxZMqOaR7B17/pJotew4AcO2Jg1lRvYdVW2p4aPYqhvfqyDUnHMK8z7azaed+KruW8NnWGvJ8Ps4c04uF63awbvs+enQs4uQRPVizpYbRfTuFTdtH63ayYO12EMEnUFKYT4+ORXRqX8D/N+tTenUqZlTvMhav30m/Lu3ZV1tPeYd2bKk5QL5P2HewgY7F+eTn+fAJ5Imw50AdO/bWMrJXRzbu3E/XDoUAfLFrP0UFeZw6qo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0UU4zw5f4O5fV5zK3eXAf4Au7vwC/J+77x8BVQHrugxY4f5dmu5987Dvx9PUumkgzo9/BfAPoJ07vch9v8L9fGDA8j91v4dleGjxke4/YAww1z3W/8JpxZKzxxm4DVgKLAb+htNCKeeOM/AETr1LLU6O8fJEHlegyv0OV+I8s0eipcmG5TDGGBNWWy9uMsYYE4EFCWOMMWFZkDDGGBOWBQljjDFhWZAwxhgTlgUJY0IQkT3u/5Ui8rUEr/snQe/fTeT6jUkkCxLGRFYJxBQkAnoBh9MsSKjqpBjTZEzKWJAwJrIZwDEissB9pkGeiNwtInPcMfyvABCR40XkLRF5Hqc3MCLyLxGZ5z4HYbo7bQZQ7K7vMXeaP9ci7roXu2P+fzVg3W9I0/MjHvP0HABjEiDaHY8xbd0NwA9V9XQA92K/U1UPF5F2wDsi8qo77zhglKqudt9fpqrbRKQYmCMiz6jqDSLyHVUdE2JbZ+P0pB4NdHOXme1+NhYYCWwA3sEZu+jtRO+sMcEsJ2FMbKbgjJezAGcY9q44YwABfBAQIACuFZGFwP9wBlwbTGRHA0+oar2qfgG8CRwesO51qtqAM9xKZQL2xZioLCdhTGwEuEZVmw2EJyLH4wzZHfj+JJyH2uwVkTdwxhSK14GA1/XYb9ekiOUkjIlsN86jYP1mAle6Q7IjIkPcB/4EKwO2uwFiGM4jI/1q/csHeQv4qlvvUY7zKMtsGKXU5DC7GzEmskVAvVts9AjO8yoqgflu5fFm4MshlnsF+LaIfIIz4uj/Aj57EFgkIvPVGdrc71mcx3AuxBnN93pV3eQGGWPSwkaBNcYYE5YVNxljjAnLgoQxxpiwLEgYY4wJy4KEMcaYsCxIGGOMCcuChDHGmLAsSBhjjAnr/wcwLM3rpYTgrgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "bestIndividuals, bestScores = GA(n_iteration, populationSize, codeLen, targetFunction, crossOverRate, mutateRate)\n",
    "plt.plot(bestScores)\n",
    "plt.xlabel(\"Iteration\")\n",
    "plt.ylabel(\"Best Fitness per Iteration\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'x value of best fitness')"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAArYUlEQVR4nO3dd5hU5dnH8e+9u8DS69LLUgVERFxrxIpRbKQYwcRYolFj3kSNrwmmaDRNk2jUmKi8mlhj7C02FJXYEAFRkCIgIL3D0tlyv3+cM8vM7MzuLOzMsju/z3XttTPPOTNzz5yZc5+nnOeYuyMiItkrp64DEBGRuqVEICKS5ZQIRESynBKBiEiWUyIQEclyeXUdQE116NDBCwsL6zoMEZF6Zdq0aevcvSDRsnqXCAoLC5k6dWpdhyEiUq+Y2ZJky9LaNGRmV5rZLDP7zMyuSrDczOxOM1tgZp+a2fB0xiMiIpWlLRGY2RDg+8DhwMHAGWbWL261UUD/8O9S4O50xSMiIomls0YwCPjQ3be7eykwCfhG3DqjgYc8MBloY2Zd0hiTiIjESWcimAWMMLP2ZtYMOA3oEbdON2Bp1P1lYZmIiGRI2jqL3X2Omd0CTAC2ATOAsr15LjO7lKDpiJ49e9ZWiCIiQpo7i939fnc/1N2PBTYCn8etspzYWkL3sCz+eca7e5G7FxUUJBz9JCIieyndo4Y6hv97EvQP/CtulReA88PRQ0cCm919ZTpjEhGRWOk+j+BpM2sPlAA/dPdNZnY5gLvfA7xM0HewANgOXJSuQHaXlvP8jOWcfWh3zCxdLyMiUu+kNRG4+4gEZfdE3Xbgh+mMI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JKBCIiWU6JQEQkyykRiIhkuf8HtfWDizYeESAAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "bestPosition = [decode(y) for y in bestIndividuals]\n",
    "plt.plot(bestPosition)\n",
    "plt.xlabel(\"Iteration\")\n",
    "plt.ylabel(\"x value of best fitness\")"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "494899efd6527d56ea7f55c588d0081523a17dc3a9ff1107f3394ad815ff2527"
  },
  "kernelspec": {
   "display_name": "Python 3.7.7 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
